//
//  LTY_DayTableViewCell.m
//  MooMusic
//
//  Created by 守护神 on 15/10/22.
//  Copyright © 2015年 wjy. All rights reserved.
//

#import "LTY_DayTableViewCell.h"

@implementation LTY_DayTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self creatDaySubviews];
    }
    
    return self;
}

- (void)creatDaySubviews
{
    desLabel = [[UILabel alloc] init];
    //desLabel.backgroundColor = [UIColor orangeColor];
    desLabel.numberOfLines = 0;
    // 自适应宽度
    [desLabel sizeToFit];
    [self.contentView addSubview:desLabel];
    
    bigPicImageView = [[UIImageView alloc] init];
    //bigPicImageView.backgroundColor = [UIColor greenColor];
    [self.contentView addSubview:bigPicImageView];
    
    playButton = [[UIButton alloc] init];
//    playButton.backgroundColor = [UIColor redColor];
    [bigPicImageView addSubview:playButton];
    
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    [desLabel mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.equalTo(self.contentView).with.offset(10);
        make.left.equalTo(self.contentView).with.offset(10);
        make.width.mas_equalTo(SCREENWIDTH - 20);
        
    }];
    
    
    [bigPicImageView mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.equalTo(desLabel.mas_bottom).with.offset(5);
        make.left.equalTo(self.contentView).with.offset(10);
        make.width.mas_equalTo(SCREENWIDTH - 20);
        make.height.mas_equalTo(160);
        
    }];
    
    
    
        
        
    playButton.frame = CGRectMake(150 * WIDTH, 45 * HEIGH, 60 * WIDTH, 60 * HEIGH);
//    playButton.backgroundColor = [UIColor yellowColor];
    
    [playButton setImage:[UIImage imageNamed:@"bofang-2@2x.png"] forState:UIControlStateNormal];
    
}

// 重写get方法
- (void)setModel:(LTY_MVDayModel *)model
{
    _model = model;
    desLabel.text = model.desc;
//    NSLog(@"%@",model.desc);
    [bigPicImageView sd_setImageWithURL:[NSURL URLWithString:model.bigPicUrl] placeholderImage:[UIImage imageNamed:@"mv_big_cover_default.jpg"]];
    
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
